package com.xyc.gulimall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xyc.common.to.mq.SeckillOrderTo;
import com.xyc.common.utils.PageUtils;
import com.xyc.gulimall.order.entity.OrderEntity;
import com.xyc.gulimall.order.vo.*;

import java.text.ParseException;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author xyc
 * @email xyc@gmail.com
 * @date 2024-07-15 19:23:08
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 订单确认页需要返回使用的数据
     *
     * @return
     */
    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    /**
     * 下单
     *
     * @param orderSubmitVo
     * @return
     */
    SubmitOrderResponseVo submitOrder(OrderSubmitVo orderSubmitVo);

    /**
     * 按照订单好查询订单信息
     *
     * @param orderSn
     * @return
     */
    OrderEntity getOrderByOrderSn(String orderSn);

    void closeOrder(OrderEntity orderEntity);

    /**
     * 获取当前订单的支付信息
     *
     * @param orderSn
     * @return
     */
    PayVo getOrderPay(String orderSn);

    PageUtils queryPageWithItem(Map<String, Object> params);

    String handlePayResult(PayAsyncVo vo) throws ParseException;

    void createSeckillOrder(SeckillOrderTo seckillOrderTo);
}

